# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AuthorizedBuyersMarketplace.V1.Model.UpdateDealRequest do
  @moduledoc """
  Request message for updating the deal at the given revision number.

  ## Attributes

  *   `deal` (*type:* `GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Deal.t`, *default:* `nil`) - Required. The deal to update. The deal's `name` field is used to identify the deal to be updated. Note: proposal_revision will have to be provided within the resource or else an error will be thrown. Format: buyers/{accountId}/proposals/{proposalId}/deals/{dealId}
  *   `updateMask` (*type:* `String.t`, *default:* `nil`) - List of fields to be updated. If empty or unspecified, the service will update all fields populated in the update request excluding the output only fields and primitive fields with default value. Note that explicit field mask is required in order to reset a primitive field back to its default value, for example, false for boolean fields, 0 for integer fields. A special field mask consisting of a single path "*" can be used to indicate full replacement(the equivalent of PUT method), updatable fields unset or unspecified in the input will be cleared or set to default value. Output only fields will be ignored regardless of the value of updateMask.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :deal => GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Deal.t() | nil,
          :updateMask => String.t() | nil
        }

  field(:deal, as: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.Deal)
  field(:updateMask)
end

defimpl Poison.Decoder, for: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.UpdateDealRequest do
  def decode(value, options) do
    GoogleApi.AuthorizedBuyersMarketplace.V1.Model.UpdateDealRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AuthorizedBuyersMarketplace.V1.Model.UpdateDealRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
